<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/mall/Sellingrules.js此处编写
 -->
<template>
  <div>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" :editFormFileds="editFormFields" :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields" :searchFormFileds="searchFormFields" :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
    </view-grid>
  </div>
</template>

<script>
import extend from "@/extension/mall/Sellingrules.js";
import ViewGrid from "@/components/basic/ViewGrid.vue";
var vueParam = {
  components: {
    ViewGrid,
  },
  data() {
    return {
      table: {
        key: "id",
        footer: "Foots",
        cnName: "售卖规则",
        name: "Sellingrules",
        url: "/Sellingrules/",
        sortName: "createDate",
      },
      extend: extend,
      editFormFields: {
        saleName: "",
        isPurchaseLimit: "",
        singleType: [],
        singleId: "",
        singleInterval: "",
        singleTicket: "",
        singleOrder: "",
        partiallyVisible: [],
        idCardRestrictions: "",
        limitGender: "",
        limitAge: "",
        limitArea: "",
        limitProvince: "",
        leastAdvanceDay: "",
        minOrder: "",
        maxOrder: "",
        isRealName: "",
        RealNameType: "",
        isHint: "",
        hintChoose: "",
        riskHint: "",
        epidemicHint: "",
        isReserve: "",
        creator: "",
        createDate: "",
        modifier: "",
        modifyDate: "",
        advancePeriod: "",
        purchaseLimit: "",
        isRealNamePurchase: "",
        isPreSale: "",
        modifyID: "",
        createID: "",
        isBlacklist: "",
        saleCode: "",
        isAvailable: "",
        isDelete: "",
        merchantCode: "",
        merchantName: "",
        quotaType: "",
        singleprice: "",
        limitMaxAge: ''
      },
      editFormOptions: [
        [
          {
            title: "售卖名称",
            required: true,
            field: "saleName",
            colSize: 5,
            type: "text",
          },
        ],
        [
          {
            dataKey: "enable",
            data: [],
            title: "是否限购",
            field: "isPurchaseLimit",
            colSize: 3,
            type: "switch",
          },
          {
            dataKey: "quotaType",
            data: [],
            title: "限购类型",
            field: "quotaType",
            colSize: 9,
            type: "radio",
            hidden: true,
          },
        ],
        [
          {
            dataKey: "singleId",
            data: [],
            title: "条件ID",
            field: "singleId",
            colSize: 4,
            type: "select",
          },
          {
            dataKey: "idCardRestrictions",
            data: [],
            title: "身份证判断限制",
            field: "idCardRestrictions",
            colSize: 5,
            type: "checkbox",
          },
        ],
        [
          {
            dataKey: "gender",
            data: [],
            title: "限制性别",
            field: "limitGender",
            disabled: true,
            colSize: 4,
            type: "select",
          },
          {
            title: "限制最小年龄",
            field: "limitAge",
            disabled: true,
            colSize: 4,
            type: "number",
          },
          {
            title: "限制最大年龄",
            field: "limitMaxAge",
            disabled: true,
            colSize: 4,
            type: "number",
          },

          // {
          //   dataKey: "CityCode",
          //   data: [],
          //   title: "限制地区(市)",
          //   field: "limitArea",
          //   disabled: true,
          //   colSize: 4,
          //   type: "select",
          // },
        ],
        [
          {
            dataKey: "getCity",
            data: [],
            title: "限制地区",
            field: "limitArea",
            disabled: true,
            colSize: 4,
            type: "cascader",
            changeOnSelect: true,
          },
        ],
        [
          {
            dataKey: "singleType",
            data: [],
            title: "限购方式",
            field: "singleType",
            colSize: 7,
            type: "checkbox",
          },
        ],
        [
          {
            title: "间隔时长",
            field: "singleInterval",
            disabled: true,
            colSize: 3,
            type: "number",
          },
          {
            title: "票数",
            field: "singleTicket",
            disabled: true,
            colSize: 3,
            type: "number",
          },
          {
            title: "限购订单数",
            field: "singleOrder",
            disabled: true,
            colSize: 3,
            type: "number",
          },
          {
            dataKey: "partiallyVisible",
            data: [],
            title: "仅部分可见",
            field: "partiallyVisible",
            colSize: 3,
            type: "selectList",
            readonly: true,
          },
        ],
        [
          {
            title: "最少提前几天",
            field: "leastAdvanceDay",
            colSize: 4,
            type: "number",
          },
          {
            title: "最小起订量",
            field: "minOrder",
            colSize: 4,
            type: "number",
          },
          {
            title: "最大起订量",
            field: "maxOrder",
            colSize: 4,
            type: "number",
          },
        ],

        [
          {
            dataKey: "enable",
            data: [],
            title: "是否实名制",
            field: "isRealName",
            colSize: 3,
            type: "switch",
          },
          {
            dataKey: "RealNameType",
            data: [],
            title: "实名制类型",
            field: "RealNameType",
            colSize: 9,
            type: "radio",
          },
        ],
        [
          {
            dataKey: "enable",
            data: [],
            title: "是否提示",
            field: "isHint",
            colSize: 3,
            type: "switch",
          },
          {
            dataKey: "hintChoose",
            data: [],
            title: "风险类型",
            field: "hintChoose",
            colSize: 9,
            type: "radio",
          },
        ],
        [
          {
            title: "风险提示",
            field: "riskHint",
            disabled: true,
            colSize: 6,
            type: "textarea",
          },
          {
            title: "疫情提示",
            field: "epidemicHint",
            disabled: true,
            colSize: 6,
            type: "textarea",
          },
        ],
        [
          {
            dataKey: "enable",
            data: [],
            title: "预约验证",
            field: "isReserve",
            colSize: 3,
            type: "switch",
          },
        ],
        [
          //   {"title":"主键","required":true,"field":"id","disabled":true,"type":"number"},
          { title: "创建人", field: "creator", disabled: true },
          { title: "创建时间", field: "createDate", disabled: true },
          { title: "修改人", field: "modifier", disabled: true },
          { title: "修改时间", field: "modifyDate", disabled: true },
          {
            title: "提前预定？天",
            field: "advancePeriod",
            disabled: true,
            type: "number",
          },
          {
            title: "限购单ID",
            field: "purchaseLimit",
            disabled: true,
            type: "number",
          },
          {
            title: "是否实名购买",
            field: "isRealNamePurchase",
            disabled: true,
            type: "number",
          },
          {
            title: "是否预售",
            field: "isPreSale",
            disabled: true,
            type: "number",
          },
          {
            title: "修改人ID",
            field: "modifyID",
            disabled: true,
            type: "number",
          },
          {
            title: "创建人ID",
            field: "createID",
            disabled: true,
            type: "number",
          },
          {
            title: "是否黑名单",
            field: "isBlacklist",
            disabled: true,
            type: "number",
          },
          { title: "售卖编码", field: "saleCode", disabled: true },
          { title: "是否可用", field: "isAvailable", disabled: true },
          {
            title: "是否删除",
            field: "isDelete",
            disabled: true,
            type: "number",
          },
        ],
      ],
      searchFormFields: {
        isPurchaseLimit: "",
        singleType: "",
        singleInterval: "",
        singleTicket: "",
        singleOrder: "",
        singleId: "",
        partiallyVisible: "",
        idCardRestrictions: "",
        isRealName: "",
        isHint: "",
        hintChoose: "",
        isReserve: "",
      },
      searchFormOptions: [
        [
          { field: "saleName", title: "售卖名称", type: "like" },
          {
            dataKey: "enable",
            data: [],
            title: "是否限购",
            field: "isPurchaseLimit",
            type: "select",
          },
          {
            dataKey: "enable",
            data: [],
            title: "是否实名制",
            field: "isRealName",
            type: "select",
          },
          {
            dataKey: "enable",
            data: [],
            title: "是否提示",
            field: "isHint",
            type: "select",
          },
        ],
        [
          {
            dataKey: "enable",
            data: [],
            title: "预约验证",
            field: "isReserve",
            type: "select",
          },
          {
            dataKey: "singleType",
            data: [],
            title: "限购方式",
            field: "singleType",
            type: "select",
          },
          { title: "限购订单数", field: "singleOrder", type: "number" },
          { title: "票数", field: "singleTicket", type: "number" },
        ],
        [
          { title: "购买间隔时长", field: "singleInterval", type: "number" },
          {
            dataKey: "singleId",
            data: [],
            title: "单一ID1 手机号 2 身份证号",
            field: "singleId",
            type: "select",
          },
          {
            dataKey: "idCardRestrictions",
            data: [],
            title: "身份证判断限制",
            field: "idCardRestrictions",
            type: "select",
          },
          {
            dataKey: "partiallyVisible",
            data: [],
            title: "仅部分可见",
            field: "partiallyVisible",
            type: "select",
          },
        ],
        [
          {
            dataKey: "hintChoose",
            data: [],
            title: "1风险提示 2疫情提示 3 风险、疫情提示",
            field: "hintChoose",
            type: "select",
          },
        ],
      ],
      columns: [
        {
          field: "id",
          title: "主键",
          type: "int",
          width: 90,
          hidden: true,
          readonly: true,
          require: true,
          align: "left",
        },
        {
          field: "saleName",
          title: "售卖名称",
          type: "string",
          width: 120,
          require: true,
          align: "left",
          sortable: true,
        },
        {
          field: "isPurchaseLimit",
          title: "是否限购",
          type: "int",
          bind: { key: "enable", data: [] },
          width: 80,
          align: "left",
        },
        {
          field: "leastAdvanceDay",
          title: "最少提前几天",
          type: "int",
          width: 100,
          align: "left",
        },
        {
          field: "minOrder",
          title: "最小起订量",
          type: "int",
          width: 90,
          align: "left",
        },
        {
          field: "maxOrder",
          title: "最大起订量",
          type: "int",
          width: 90,
          align: "left",
        },
        {
          field: "singleType",
          title: "限购方式",
          type: "int",
          bind: { key: "singleType", data: [] },
          width: 110,
          align: "left",
        },
        {
          field: "singleInterval",
          title: "购买间隔时长",
          type: "decimal",
          width: 100,
          readonly: true,
          align: "left",
        },
        {
          field: "singleTicket",
          title: "票数",
          type: "int",
          width: 100,
          readonly: true,
          align: "left",
        },
        {
          field: "singleOrder",
          title: "限购订单数",
          type: "int",
          width: 90,
          readonly: true,
          align: "left",
        },
        {
          field: "singleId",
          title: "单一ID",
          type: "int",
          bind: { key: "singleId", data: [] },
          width: 120,
          align: "left",
        },
        {
          field: "partiallyVisible",
          title: "仅部分可见",
          type: "string",
          bind: { key: "partiallyVisible", data: [] },
          width: 190,
          align: "left",
          readonly: true,
        },
        {
          field: "idCardRestrictions",
          title: "身份证判断限制",
          type: "string",
          bind: { key: "idCardRestrictions", data: [] },
          width: 130,
          align: "left",
        },
        {
          field: "limitGender",
          title: "限制性别 1男 2 女",
          type: "int",
          bind: { key: "gender", data: [] },
          width: 80,
          readonly: true,
          align: "left",
        },
        {
          field: "limitAge",
          title: "限制年龄",
          type: "int",
          width: 80,
          readonly: true,
          align: "left",
        },
        {
          field: "limitArea",
          title: "限制地区",
          type: "string",
          bind: { key: "getCity", data: [] },
          width: 80,
          readonly: true,
          align: "left",
        },
        {
          field: "isRealName",
          title: "是否实名制",
          type: "int",
          bind: { key: "enable", data: [] },
          width: 90,
          align: "left",
        },
        {
          field: "RealNameType",
          title: "实名制选择",
          type: "string",
          bind: { key: "RealNameType", data: [] },
          width: 150,
          align: "left",
        },
        {
          field: "isHint",
          title: "是否提示",
          type: "int",
          bind: { key: "enable", data: [] },
          width: 80,
          align: "left",
        },
        {
          field: "hintChoose",
          title: "风险类型",
          type: "int",
          bind: { key: "hintChoose", data: [] },
          width: 120,
          align: "left",
        },
        {
          field: "riskHint",
          title: "风险提示",
          type: "string",
          width: 150,
          readonly: true,
          align: "left",
        },
        {
          field: "epidemicHint",
          title: "疫情提示",
          type: "string",
          width: 150,
          readonly: true,
          align: "left",
        },
        {
          field: "isReserve",
          title: "预约验证",
          type: "string",
          bind: { key: "enable", data: [] },
          width: 80,
          align: "left",
        },
        {
          field: "creator",
          title: "创建人",
          type: "string",
          width: 100,
          readonly: true,
          align: "left",
        },
        {
          field: "createDate",
          title: "创建时间",
          type: "datetime",
          width: 160,
          readonly: true,
          align: "left",
          sortable: true,
        },
        {
          field: "modifier",
          title: "修改人",
          type: "string",
          width: 100,
          readonly: true,
          align: "left",
        },
        {
          field: "modifyDate",
          title: "修改时间",
          type: "datetime",
          width: 160,
          readonly: true,
          align: "left",
          sortable: true,
        },
        {
          field: "modifyID",
          title: "修改人ID",
          type: "int",
          width: 90,
          hidden: true,
          readonly: true,
          align: "left",
        },
        {
          field: "createID",
          title: "创建人ID",
          type: "int",
          width: 90,
          hidden: true,
          readonly: true,
          align: "left",
        },
      ],
      detail: {
        cnName: "#detailCnName",
        columns: [],
        sortName: "",
        key: "",
      },
    };
  },
};
export default vueParam;
</script>
// 18518227427
